<?php
namespace app\controllers;

use app\models\Job;
use Yii;
use yii\base\Controller;

/*
 * 控制器说明：
 *  前台公共控制器
 */

class CommonController extends Controller{
    public function actionNotFound(){
        return $this->renderPartial("404");
    }

    public function actionBossEntry(){
        if(Yii::$app->request->isPost){
            $post = Yii::$app->request->post('Job');
            $model = new Job();
            $model->setAttributes($post,false);
            $model->save(false);
            echo "<script>alert('我们已经成功接受到你的请求！我们会尽快与你联系，请保持你的联系通畅!');location.href='index.php'</script>";
        }else{
            $model = new Job();
            return $this->renderPartial('bossEntry',['model'=>$model]);
        }
    }
}